# Contributor: Guy Godfroy <guy.godfroy@gugod.fr>
# Maintainer: Guy Godfroy <guy.godfroy@gugod.fr>
pkgname=confd
pkgver=0.30.0
pkgrel=0
pkgdesc="manage local application configuration files using templates and data from multiple backends"
url="https://github.com/abtreece/confd"
arch="all"
license="MIT"
checkdepends="go"
subpackages="$pkgname-openrc $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/abtreece/confd/archive/refs/tags/v$pkgver.tar.gz
	confd.initd
	confd.toml
	"

build() {
	go build -o confd ./cmd/confd
}

check() {
	go test ./...
}

package() {
	install -m755 -D "$builddir"/confd "$pkgdir"/usr/bin/confd
	install -m644 -D "$srcdir"/confd.toml "$pkgdir"/etc/confd/confd.toml
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$builddir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
e6e008c83676f50e10b7715294cf546134f3b0d3efa4ada47cd757b120641bfbce2a86a62cb3fb3aae80436014d5f5a1e36ec2c55ed1d5ce50ed90830d8940a9  confd-0.30.0.tar.gz
68768138569399d6a17b7789c49e59c69f599c77ab038f70655c5e254a0cd47d7f969363c3d20ab0f55b93249fdcd4beb3d8044d5d6b14c40766bfed15aaf135  confd.initd
2cf0f14ff304a358396279d7b681720da4b673546d75d8ccadd8abcda7465891c20007e7fbbd47dc5c9e03722b986664bb141177f94a0b531cacf147ae1cd79f  confd.toml
"
